package cn.dongqihong.oauth2.mapper;

import cn.dongqihong.oauth2.entity.App;
import cn.dongqihong.oauth2.entity.AppToken;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

public interface AppMapper {

    void insertInfo(App app);

    App findById(Long id);

    Long insertToken(Map<String, Object> appToken);

    AppToken findTokenByCode(Long code);

    AppToken findTokenByAccessToken(String accessToken);

    AppToken findTokenByRefreshToken(String refreshToken);

    void updateRefreshTokenByCode(Map<String, Object> appToken);

    AppToken findTokenByAppIdAndUserId(@Param("appId") Long appId, @Param("userId") Long userId);
}
